import React, { Component } from 'react'
// 引入加载路由视图得函数组件
import RouterView from '@/router/index'
import { Link } from 'react-router-dom'
import { Divider, Space } from 'antd'
import PropTypes from 'prop-types'

export default class Set extends Component {
  constructor(prop) {
    super(prop)
    this.state = {}
  }

  render() {
    const { path } = this.props.match
    const { routes } = this.props
    return (
      <div>
        <Space>
          <Link to={`${path}/global`}>Global</Link>
          <Link to={`${path}/dict`}>Dict</Link>
        </Space>
        <Divider />
        <RouterView routes={routes} />
      </div>
    )
  }
}
Set.propTypes = {
  match: PropTypes.object.isRequired,
  routes: PropTypes.array.isRequired
}
